<%--
  Created by IntelliJ IDEA.
  User: landeqing
  Date: 2018/1/24
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="/jquery/jquery-3.2.1.min.js"></script>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript">
        function toPayMoney(payStatus) {
            var orderId='${orderId}';
            $.ajax({
                url:"/order/payMoney?orderId="+orderId+"&payStatus="+payStatus,
                type:"get",
                cache:false,
                success:function (res) {
                    if(res==1){
                        alert("支付成功！")
                    }else {
                        alert("请在30分钟内完成支付，否则订单自动过期")
                    }
                }
            });

        }
    </script>
</head>
<body>

<form method="post" action="/order/orderList">
    <input type="hidden" name="uid" value="${sessionScope.user.id}">
    <table>
        <tr>
            <td>
                订单提交成功！
            </td>
        </tr>
        <tr>
            <td>订单编号${orderId}&nbsp;&nbsp;&nbsp;  应付金额为：${totalPrice}</td>
        </tr>
        <tr>
            <td><input type="radio" name="payStatus" value="1" onclick="toPayMoney(1)" id="payStatus"/>立即支付</td>
            <td><input type="radio" name="payStatus" value="2" onclick="toPayMoney(2)">稍后支付</td>
        </tr>
        <tr>
            <td>
                <input type="submit" value="完成"/>
            </td>
        </tr>

    </table>
</form>







</body>
</html>
